<template>
  <vue-ueditor-wrap v-model="value" :config="editorConfig" :editor-id="editorId" />
</template>

<script lang="ts" setup>
interface Props {
  value: string
}

const props = withDefaults(defineProps<Props>(), {
  value: '<h2>Hello World!</h2>'
})

const editorConfig = {
  UEDITOR_HOME_URL: '/UEditor/',
  serverUrl: import.meta.env.VITE_BASE_API + '/ueditor/exec',
}

const editorId = 'editor-' + Math.random().toFixed(6).slice(-6)
</script>
